package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFetchInformationDao;
import com.financing.platform.dto.FetchInformationDTO;
import com.financing.platform.service.IFetchInformationService;
/**
 * fetch_information  
 * 抓取资讯表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fetchInformationService")
public class FetchInformationServiceImpl implements IFetchInformationService{

	@Autowired
	private IFetchInformationDao fetchInformationDao;

	@Override
	public int insert(FetchInformationDTO fetchInformation) throws SQLException {
		return fetchInformationDao.insert(fetchInformation);
	}

	@Override
	public void update(FetchInformationDTO fetchInformation) throws SQLException {
		fetchInformationDao.update(fetchInformation);
	}

	@Override
	public void updateForce(FetchInformationDTO fetchInformation) throws SQLException {
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fetchInformationDao.delete(id);
	}
	
	@Override
	public List<FetchInformationDTO> queryList(FetchInformationDTO fetchInformation) throws SQLException {
		return fetchInformationDao.queryList(fetchInformation);
	}

	@Override
	public List<FetchInformationDTO> queryFetchInfoList(FetchInformationDTO fetchInformation) throws SQLException {
		return fetchInformationDao.queryFetchInfoList(fetchInformation);
	}
	
	@Override
	public int queryListCount(FetchInformationDTO fetchInformation) throws SQLException {
		return fetchInformationDao.queryListCount(fetchInformation);
	}

	@Override
	public FetchInformationDTO loadById(Integer id) throws SQLException {
		return fetchInformationDao.loadById(id);
	}
 	@Override
	public FetchInformationDTO queryListGetFirst(FetchInformationDTO fetchInformation)
			throws SQLException {
		 List<FetchInformationDTO> queryList = queryList(fetchInformation);
		 if(queryList==null||queryList.size()==0){
			 return new FetchInformationDTO();
		 }
		 return queryList.get(0);
	}
}
